package com.yunhai.system.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.yunhai.system.mapper.InvestorRelationMapper;
import com.yunhai.system.domain.InvestorRelation;
import com.yunhai.system.service.IInvestorRelationService;

import java.util.List;
import java.util.Map;

/**
 * 投资者关系Service业务层处理
 *
 * @author jxj
 * @date 2021-01-21
 */
@Service
public class InvestorRelationServiceImpl extends ServiceImpl<InvestorRelationMapper, InvestorRelation> implements IInvestorRelationService {

    @Override
    public List<InvestorRelation> queryList(InvestorRelation investorRelation) {
        LambdaQueryWrapper<InvestorRelation> lqw = Wrappers.lambdaQuery();
        if (StringUtils.isNotBlank(investorRelation.getReportTitle())) {
            lqw.eq(InvestorRelation::getReportTitle, investorRelation.getReportTitle());
        }
        lqw.eq(InvestorRelation::getType, investorRelation.getType());
        lqw.orderByDesc(InvestorRelation::getPushTime,InvestorRelation::getCreateTime);
        return this.list(lqw);
    }
}
